<template>
	<view class="page">
		<u-navbar :title="t_title?t_title:'期刊详情'" :auto-back="true">
			<view class="u-nav-slot" slot="right">
				<view class="nav-right" @click="openPopUp">
					<u-icon name="search" size="24" color="#376CB4"></u-icon>
					<u-icon name="list" size="24" style="margin-left: 20rpx;" color="#376CB4"></u-icon>
				</view>
			</view>
		</u-navbar>
		<view class="ll"></view>

		<view class="detail-title">{{rst.title}}</view>

		<view class="detail-author font-24" v-if="module == 3">{{rst.actor}}</view>
		<view class="detail-author font-24" v-if="module == 3 && rst.danwei">({{rst.danwei}})</view>

		<view class="detail-nums font-24" v-if="module == 3">
			浏览次数：{{rst.hits}}次 下载次数：{{rst.download}}次
		</view>

		<view class="detail-nums font-24" v-if="module == 2 || module == 1 || module == 4">发布时间：{{rst.addtime}}
			浏览次数：{{rst.hits}}次</view>


		<view class="detail-content">
			<u-parse v-if="module == 2 || module == 1 || module == 4" :content="rst.content" :domain="BaseImgUrl"
				:tagStyle="style"></u-parse>
			<view v-if="module == 3" class="detail-content-3-box">
				<view>
					<text class="fontbold">摘要</text>:<text v-html="rst.description"></text>
				</view>
				<view><text class="fontbold">关键词</text>{{rst.keywords}}</view>
				<view class="detail-content-3">
					<view class="detail-content-3-i">
						<text class="fontbold ">中图分类号:</text><text>{{rst.flh}}</text>
					</view>
					<view class="detail-content-3-i">
						<text class="fontbold ">文献标志码:</text><text>{{rst.products.size}}</text>
					</view>
					<view class="detail-content-3-i">
						<text class="fontbold ">文章编号:</text><text>{{rst.products.price1}}</text>
					</view>
				</view>
				<u-parse :content="rst.content" :domain="BaseImgUrl" :tagStyle="style"></u-parse>
			</view>
		</view>



		<Footer></Footer>
		<u-back-top :scroll-top="scrollTop" bottom="20" icon="arrow-up" right="10"
			:iconStyle="{color:'#2979ff'}"></u-back-top>
		<CommonTk ref="commonTk"></CommonTk>
	</view>
</template>

<script>
	import CommonTk from '@/components/CommonTk.vue'
	import Footer from '@/components/Footer.vue'
	import {
		api,
		BaseImgUrl,
		http
	} from '@/config/common.js'
	export default {
		data() {
			return {
				t_title: '',
				module: 1,
				rst: {},
				BaseImgUrl: BaseImgUrl,
				scrollTop: 0,
				style: {
					// 字符串的形式
					p: 'color: #333333;line-height: 50rpx;font-weight: 400;font-family: PingFang SC;font-size: 30rpx;',
					span: 'color: #333333;line-height: 50rpx;font-weight: 400;font-family: PingFang SC;font-size: 30rpx;',
					strong: 'color: #333333;line-height: 50rpx !important;font-family: PingFang SC;font-size: 30rpx;'
				},
				content: ''
			}
		},
		components: {
			Footer,
			CommonTk
		},
		filters: {},
		mounted() {},
		onLoad(e) {
			if (e.title) {
				this.t_title = e.title
				uni.setNavigationBarTitle({
					title:e.title
				})
			}

			this.getData(e.id)
		},
		onShow() {},
		beforeDestroy() {},
		onPageScroll(e) {
			this.scrollTop = e.scrollTop;
		},
		methods: {
			openPopUp() {
				this.$refs.commonTk.openShow()
			},
			getData(id) {
				api.post('api/index/content_detail', {
					id: id
				}).then(res => {
					let rst = res.data
					if (rst.code == 1) {
						this.rst = rst.data
						this.module = rst.data.columns.module
					}
				}).catch(err => {})
			},
		}
	};
</script>

<style scoped>
	.detail-content-3-box {
		color: #333333;
		line-height: 50rpx;
		font-weight: 400;
		font-family: PingFang SC;
		font-size: 27rpx;
	}

	.detail-content-3 {
		display: flex;
		flex-direction: row;
		align-items: center;
		margin-bottom: 20rpx;
		flex-wrap: wrap;
	}

	.detail-content-3-i {
		margin-right: 20rpx;
	}

	.detail-content {
		color: #333333;
		line-height: 50rpx !important;
		font-weight: 400;
		font-family: PingFang SC;
		font-size: 28rpx;
		width: 690rpx;
		margin: 0 auto;
		margin-top: 30rpx;
	}

	.detail-nums {
		width: 690rpx;
		margin: 0 auto;
		text-align: center;
		margin-top: 40rpx;
		font-size: 24rpx;
		font-family: PingFang SC;
		font-weight: 400;
		color: #999999;
	}

	.detail-author {
		width: 690rpx;
		margin: 0 auto;
		text-align: center;
		margin-top: 20rpx;
	}

	.detail-title {
		width: 690rpx;
		margin: 0 auto;
		text-align: center;
		font-size: 38rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-top: 30rpx;
	}

	.ll {
		height: 100rpx;
	}

	::v-deep .u-navbar__content {
		width: 750rpx;
		height: 88rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 2rpx 14rpx 0rpx rgba(4, 0, 0, 0.14);
	}

	.nav-right {
		display: flex;
		flex-direction: row;
		align-items: center;
	}

	.logo {
		width: 306rpx !important;
		height: 55rpx !important;
	}

	page {
		background-color: #fff;
	}
</style>